//
//  AnyButtonTableViewCell.m
//  Test
//
//  Created by lingji001 on 2018/8/3.
//  Copyright © 2018年 lingji001. All rights reserved.
//

#import "AnyButtonTableViewCell.h"

@interface AnyButtonTableViewCell ()

@property (nonatomic , strong) UIButton *firstButton;

@property (nonatomic, strong) UIButton *secondButton;

@property (nonatomic, strong) UIButton *threeButton;

@property (nonatomic, strong) UIButton *fourButton;

@end

@implementation AnyButtonTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
//        [self configUI];
    }
    return self;
}

#pragma mark 初始化UI控件
- (void)initUI{
    self.firstButton    = [UIButton new];
    self.secondButton   = [UIButton new];
    self.threeButton    = [UIButton new];
    self.fourButton     = [UIButton new];
    [self.contentView addSubview:self.firstButton];
    [self.contentView addSubview:self.secondButton];
    [self.contentView addSubview:self.threeButton];
    [self.contentView addSubview:self.fourButton];
    for (UIButton *btn in self.contentView.subviews) {
        btn.layer.borderColor = [UIColor blackColor].CGColor;
        btn.layer.borderWidth = 1;
        btn.layer.cornerRadius = 5;
    }
}

#pragma mark 为UI控件添加约束
//- (void)configUI{
//    CGFloat distan = 10;
//    [self.firstButton mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.mas_offset(10);
//        make.width.equalTo(self.firstButton.mas_height).multipliedBy(1);
////        make.top.mas_offset(5);
//        make.centerY.mas_offset(0);
//    }];
//    [self.secondButton mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.firstButton.mas_right).mas_offset(distan);
//        make.centerY.width.height.equalTo(self.firstButton);
//    }];
//    [self.threeButton mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.secondButton.mas_right).mas_offset(distan);
//        make.centerY.width.height.equalTo(self.secondButton);
//    }];
//    [self.fourButton mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.threeButton.mas_right).mas_offset(distan);
//        make.centerY.width.height.equalTo(self.threeButton);
//        make.right.mas_offset(-10);
//    }];
//}

@end
